<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015/12/7
 * Time: 13:50
 */

class Impexcel extends  MY_Controller{
    function __construct() {
        parent::__construct();
        //加载速卖通模型
        $this->load->model('smt_model');
    }
    public function index(){
        $data['s']=1;
        $this->load->view('defaults/smt_excel',$data);
        $this->load->view('defaults/common/footer');
    }
    public function do_upload()
    {
        $config['upload_path']      = './uploads/';
        $config['allowed_types']    = 'xlsx|jpg|png';
        $config['max_size']     = 2000;
        $config['max_width']        = 0;
        $config['max_height']       = 0;

        $this->load->library('upload', $config);

        if ( ! $this->upload->do_upload('excelFile'))
        {
            $error = array('error' => $this->upload->display_errors());

            $this->load->view('upload_form', $error);
        }
        else
        {
            $data = array('upload_data' => $this->upload->data());

            $this->load->view('upload_success', $data);
        }
    }
}